# build stage
FROM node:lts-alpine as build-stage

WORKDIR /app

COPY package*.json ./

RUN npm install


COPY . .

RUN npm run build:cloud


# production stage
FROM nginx
# 挂载目录
VOLUME /home/jingyi/jingyi-ui
# 创建目录
RUN mkdir -p /home/jingyi/jingyi-ui
# 指定路径
WORKDIR /home/jingyi/jingyi-ui
# 复制conf文件到路径
COPY ./nginx.conf /etc/nginx/nginx.conf

COPY --from=build-stage /app/dist /home/jingyi/jingyi-ui

